﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Practices.Unity;

namespace ERPStore.IOC
{
	public class UnityDependencyResolver : IDependencyResolver
	{
		public UnityDependencyResolver(Microsoft.Practices.Unity.IUnityContainer container)
		{
			this.Container = container;
		}

		public Microsoft.Practices.Unity.IUnityContainer Container { get; private set; }

		public object GetService(Type serviceType)
		{
			return Container.Resolve(serviceType); ;
		}

		public IEnumerable<object> GetServices(Type serviceType)
		{
			return Container.ResolveAll(serviceType);
		}
	}
}
